﻿@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <title>Create</title>
    <script src="../../Scripts/PageCreater/Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
    <script src="../../Scripts/PageCreater/Scripts/PageCreater.js" type="text/javascript"></script>
    <link href="../../Scripts/PageCreater/Css/Style.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/PageCreater/Calendar/WdatePicker.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $.ajaxSetup({ cache: false });
            $.getJSON("/SetQuestionTask/GetCourseByOrg", function (json) {
                for (var i = 0; i < json.length; i++) {
                    $("#sltCourses").append("<option value=\"" + json[i].ID + "\">" + json[i].Name + "</option>");
                }
            });
            var str = "StartTime,开始时间,false,text|date,notnull,"
                        + "StopTime,结束时间,false,text|date,notnull,"
                        + "Remark,备注,false,text,notnull,"
                        + "IsActive,状态,false,select|激活!true|注销!false,notnull,"
                        + "Opreate,操作,false,null,null";
            CreatePageFram(str);
        })
        function SubmitPage() {
            if (!InitValidator()) {
                return false;
            }
            $.ajax({
                type: "Post",
                url: "/SetQuestionTask/Create",
                data: { courseID: $("#sltCourses").val(), isActive: $("#IsActive").val(), remark: $("#Remark").val(), startTime: $("#StartTime").val(), stopTime: $("#StopTime").val() },
                success: function () {
                    alert("创建成功！");
                    window.location = "/SetQuestionTask/Index";
                }
            });
        }
    </script>
</head>
<body>
    <div class="Content">
        <p>
            @Html.ActionLink("返回列表", "Index")
        </p>
        <p>
            <input id="btnSubmit" type="button" value="保存" class="btn3" onclick="SubmitPage()" /></p>
        <form id="Info" method="post">
        <div style="float: left; width: 30%;">
            <legend>请修改基本信息</legend>
            <div id="divContent">
                <table>
                    <tr>
                        <td>
                            选择课程
                        </td>
                        <td>
                            <select id="sltCourses">
                                <option>---请选择---</option>
                            </select>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        </form>
    </div>
</body>
</html>
